<template>
	<div id="app" v-wechat-title="this.title">
		<!-- <router-view></router-view> -->
		<!-- <table border="1" width="100%" cellpadding="0" cellspacing="0" class="text_center">
            <tr v-for="(item,index) in tableConfig.rowNum">
                <td v-for="(item1,index1) in tableConfig.colNum">{{index}}</td>
            </tr>
        </table> -->
		<el-table :data="tableConfig.tableMain" :show-header="false" :span-method="arraySpanMethod" border
			style="width: 100%">
			<el-table-column v-for="(item,index) in tableConfig.rowNum" show-overflow-tooltip>
				<template slot-scope="scope">
					<span @click="sss(scope)">{{scope.row.columnText}}</span>
				</template>
			</el-table-column>
		</el-table>
	</div>
</template>

<script>
	var _this;
	import "./assets/css/base.css"
	import "./assets/css/index.css"
	import "./assets/css/index_before.css"
	import "./assets/css/snow.css"
	export default {
		name: 'App',
		data() {
			return {
				name: "appp",
				title: "",
				procedureConfig: {},
				loginInfo: {
					userType: 0
				},
				tableData: [],
				tableConfig: {
					colNum: 5,
					rowNum: 9,
					tableMain: [{
						rowIndex: 0,
						colIndex: 0,
						rowSpan: 2,
						colSpan: 4,
						columnText: "姓名",
						columnName: "1"
					}, {
						rowIndex: 0,
						colIndex: 1,
						rowSpan: 2,
						colSpan: 5,
						columnText: "姓名",
						columnName: "realName"
					}, {
						rowIndex: 2,
						colIndex: 0,
						rowSpan: 2,
						colSpan: 3,
						columnText: "姓名",
						columnName: "realName"
					}, {
						rowIndex: 2,
						colIndex: 1,
						rowSpan: 2,
						colSpan: 6,
						columnText: "姓名",
						columnName: "realName"
					}]
				}
			}
		},
		beforeCreate() {
			_this = this;
		},
		mounted: function() {
			// var arr=[];
			for (var i = 0; i < this.tableConfig.colNum; i++) {
				_this.tableData.push({});
			}
			// this.tableData=arr;
		},
		methods: {
			arraySpanMethod({
				row,
				column,
				rowIndex,
				columnIndex
			}) {
				console.log(row)
				console.log(column)
				console.log(rowIndex)
				console.log(columnIndex)
				for (var i = 0; i < this.tableConfig.tableMain.length; i++) {
					var item = this.tableConfig.tableMain[i];
					if (rowIndex == item.rowIndex) {
						if (columnIndex === item.colIndex) {
							return [item.rowSpan, item.colSpan];
						}
					}
				}
			},
			sss: function(item) {
				console.log(item)
			},

		}
	}
</script>

<style>
</style>
